package com.ctshk.rpc.order.scenic.service.impl.app;

import com.ctshk.common.dto.Result;
import com.ctshk.rpc.order.scenic.entity.app.ScenicOrderTourist;
import com.ctshk.rpc.order.scenic.mapper.app.ScenicOrderTouristAppMapper;
import com.ctshk.rpc.order.scenic.req.app.ScenicOrderTouristReq;
import com.ctshk.rpc.order.scenic.service.app.IScenicOrderTouristAppService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@DubboService
public class ScenicOrderTouristAppServiceImpl implements IScenicOrderTouristAppService {
    @Autowired
    ScenicOrderTouristAppMapper scenicOrderTouristAppMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Result<Boolean> insertScenicOrderTourist(ScenicOrderTouristReq req) {
        ScenicOrderTourist scenicOrderTourist = new ScenicOrderTourist();
        BeanUtils.copyProperties(req, scenicOrderTourist);
        scenicOrderTouristAppMapper.insert(scenicOrderTourist);
        return Result.success(true);
    }
}
